<%-- 
    Document   : registerValues
    Created on : Mar 17, 2015, 10:44:00 PM
    Author     : user
--%>

<%@page import="java.sql.Statement"%>
<%@page import="com.uniq.db.ConnectionFactory"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
    <%
  String userName=request.getParameter("userName");
  String password=request.getParameter("password");
  String firstName=request.getParameter("firstName");
  String lastName=request.getParameter("lastName");
  String role=request.getParameter("role");
  
  Connection con=ConnectionFactory.getConnection();
  Statement s=con.createStatement();
  String query="insert into login(firstName,lastName,userName,password,role) values ('"+firstName+"','"+lastName+"','"+userName+"','"+password+"','"+role+"')";
  s.execute(query);
  
  response.sendRedirect("products.jsp");
  
    %>
    </body>
</html>
